﻿<Window x:Class="WaveTech.Scutex.Manager.Windows.ServiceLogWindow"
				xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
				xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
				xmlns:UserControls="clr-namespace:WaveTech.Scutex.Manager.UserControls"
        xmlns:themes="clr-namespace:WPF.Themes;assembly=WPF.Themes" Title="Service Logs" Height="350" Width="550" WindowStartupLocation="CenterOwner" x:Name="serviceLogsWindow">
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/DataTemplates.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</Window.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="25" />
			<RowDefinition />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition />
		</Grid.ColumnDefinitions>

		<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" Orientation="Horizontal" >
			<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Black" Grid.Row="0" Grid.Column="0" Text="   Service:  " />
			<ComboBox Grid.Row="0" Grid.Column="0" x:Name="cboServices" Width="200" ItemsSource="{Binding Source={StaticResource allActiveServicesData}}" DisplayMemberPath="Name" SelectedItem="{Binding Service, ElementName=serviceLogsWindow, Mode=TwoWay}" />
			<TextBlock Width="10" />
			<Button Content="Refresh" x:Name="btnRefresh" Click="btnRefresh_Click" />
		</StackPanel>

		<TabControl Grid.Row="1" Grid.Column="0">
			<TabItem Header="Activation Logs">
				<Grid>
					<DataGrid x:Name="gridActivationLogs" ItemsSource="{Binding Source={StaticResource servicesData}}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Extended" themes:DataGridHelper.HorizontalMouseWheelScrollingEnabled="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
						<DataGrid.Columns>
							<DataGridTextColumn
						Header="License Key" Width="1*" IsReadOnly="True"
						Binding="{Binding Path=LicenseKey}"/>
							<DataGridTextColumn
						Header="Activation Result" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=ActivationResult}"/>
							<DataGridTextColumn
						Header="Ip Address" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=IpAddress}"/>
							<DataGridTextColumn
						Header="Timestamp" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=Timestamp}"/>
						</DataGrid.Columns>
					</DataGrid>
				</Grid>
			</TabItem>
			<TabItem Header="License Activiations">
				<Grid>
					<DataGrid x:Name="gridLicenseActiviations" ItemsSource="{Binding Source={StaticResource servicesData}}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Extended" themes:DataGridHelper.HorizontalMouseWheelScrollingEnabled="True" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch">
						<DataGrid.Columns>
							<DataGridTextColumn
						Header="Activation Token" Width="1*" IsReadOnly="True"
						Binding="{Binding Path=ActivationToken}"/>
							<DataGridTextColumn
						Header="Original Token" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=OriginalToken}"/>
							<DataGridTextColumn
						Header="Activated On" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=ActivatedOn}"/>
							<DataGridTextColumn
						Header="Hardware Hash" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=HardwareHash}"/>
							<DataGridTextColumn
						Header="Activation Status" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=ActivationStatus}"/>
							<DataGridTextColumn
						Header="Activation Updated On" Width="2*" IsReadOnly="True"
						Binding="{Binding Path=ActivationStatusUpdatedOn}"/>
						</DataGrid.Columns>
					</DataGrid>
				</Grid>
			</TabItem>
		</TabControl>
		<UserControls:LoadingAnimation x:Name="loadingAnimation" Visibility="Collapsed" Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" 
							WindowHeight="{Binding ElementName=CurrentPresenter, Path=ActualHeight}" WindowWidth="{Binding ElementName=CurrentPresenter, Path=ActualWidth}" />
	</Grid>
</Window>